<!-- 标题控件设置面板 -->
<template>
    <el-tabs modelValue="widget" stretch>
        <el-tab-pane :label="`${widget.widgetData.component.title}组件`" name="widget">
            <el-scrollbar>
                <!-- 组件风格 -->
                <title-ele-mode :widget="widget" />

                <el-collapse modelValue="1">
                    <el-collapse-item title="标题内容" name="1">
                        <el-input
                            v-model="widget.widgetData.eles.content"
                            :autosize="{ minRows: 8 }"
                            clearable
                            type="textarea"
                            placeholder=""
                        >
                        </el-input>
                    </el-collapse-item>
                </el-collapse>

                <el-collapse modelValue="1">
                    <el-collapse-item title="字体样式" name="1">
                        <!-- 文字样式 -->
                        <row-font-style :widget="widget" />
                    </el-collapse-item>
                </el-collapse>
                
                <!-- 点击事件 -->
                <row-click-event :widget="widget" />
                
                <!-- 元素可见设置 -->
                <row-element-visible :widget="widget" />
            </el-scrollbar>
        </el-tab-pane>

        <el-tab-pane label="组件样式" name="style">
            <el-scrollbar>
                <el-collapse modelValue="1">
                    <el-collapse-item title="组件设置" name="1">
                        <!-- 大小 -->
                        <row-size :widget="widget" />

                        <!-- 位置 -->
                        <el-divider></el-divider>
                        <row-position :widget="widget" />

                        <!-- 背景 -->
                        <el-divider></el-divider>
                        <row-background :widget="widget" />
                        
                        <!-- 边框 -->
                        <el-divider></el-divider>
                        <row-border :widget="widget" />
                        
                        <!-- 边框阴影 -->
                        <el-divider></el-divider>
                        <row-shadow type="box-shadow" :widget="widget" />
                    </el-collapse-item>
                </el-collapse>
            </el-scrollbar>
        </el-tab-pane>
    </el-tabs>
</template>

<script>
import { defineComponent, toRefs } from 'vue'
import {
    RowSize,
    RowFontStyle,
    RowShadow,
    RowPosition,
    RowBorder,
    RowBackground,
    RowClickEvent,
    RowElementVisible
} from '../../widget-setting-row'
import TitleEleMode from './components/title-ele-mode'
export default defineComponent({
    name: 'TitleEleSetting',
    components: {
        RowSize,
        RowFontStyle,
        RowShadow,
        RowPosition,
        RowBorder,
        RowBackground,
        RowClickEvent,
        RowElementVisible,
        TitleEleMode
    },
    props: {
        widget: {
            type: Object,
            default: () => ({})
        }
    },
    setup(props) {
        const { widget } = toRefs(props)

        return {
            widget
        }
    }
})
</script>
